import mod_item
from mod_effects import doAreaOfEffectDamage

class GrenadeImpactEffect:
    def doIt(self,grenade):
        def damageFunction(distance):
            return int(round(15.0 - (5.0*distance)))
        originLocation = grenade.location
        grenade.setLocation(None)
        doAreaOfEffectDamage(originLocation,2,'MISC_EXPLOSION',damageFunction,'fire')

grenadePrototype = mod_item.ItemPrototype('GRENADE',grabbable=True)
grenadePrototype.impactEffect = GrenadeImpactEffect()